Repository navigation
test: split main_test.py into one file per area - #354
Conversation
main_test.py had grown to 6,216 lines. Its 412 tests now live in tests/, one file per area of main.py (inputs, commits, base config, checks, step log, report, outputs, main, and the unmocked integration tests), with the builders several files share in tests/helpers.py. Nothing in a test changed: every class and helper is moved as is, the same 412 tests run, and main.py stays at 100% coverage. CI now points pytest at tests/.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #354 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 1257 1257
=========================================
Hits 1257 1257
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
First of two steps that split the action's code by area. This one moves only the tests; main.py is untouched.
Before vs after
main_test.py: 6,216 lines, 412 tests in one filetests/: one file per area of main.py, the largest 1,705 linestests/inputs_test.pytests/model_test.pyScopeResultand the overall statustests/context_test.pytests/base_config_test.pyconfig-source: basetests/cli_test.pytests/log_test.pytests/report_test.pytests/publish_test.pyresultoutput, PR comment, AI labeltests/main_test.pymain()tests/integration_test.pytests/helpers.pymake_check,fail_scope, ...)tests/conftest.pyGITHUB_STEP_SUMMARYand puts the repo root onsys.pathbeforemainis importedEach file is named after the module that the next PR moves that part of main.py into.
Nothing in a test changed
Other changes
pytest testsinstead ofpytest main_test.py, in both jobs.name-tests-testskipstests/helpers.py, which has no tests. conftest.py is already exempt.The next PR moves main.py's code into an
action/package and leaves main.py as the entrypoint. In the tests, it only changes the patch targets.